function draw_decision_time(truth_label, combined_decision_label)

figure;
hold on;

% draw ground truth
% combine labels into one sorted list
combined_lbl = zeros(3, 0);
for i=1:length(truth_label)
    left_limits = truth_label{i}.region(1:2:end);
    right_limits = truth_label{i}.region(2:2:end);
    tmp_clbl = [left_limits;right_limits;ones(size(left_limits)).*i];
    combined_lbl = [combined_lbl tmp_clbl];
end

[left_limits, left_idx] = sort(combined_lbl(1, :));
[right_limits, right_idx] = sort(combined_lbl(2, :));
if any(left_idx ~= right_idx)
    error('Label not consistent. There is overlaping.');
end
combined_lbl = [left_limits; right_limits; combined_lbl(3, left_idx)];

t = draw_trace(combined_lbl, 'red', -0.01);
d = draw_trace(combined_decision_label, 'blue', 0.05);

%x = [1:size(testing_frames, 2)];
%ground_truth = testing_frames(3,:);
%idx = find(ground_truth > 0);
%plot(x(idx), ground_truth(idx), 'o','Color','red', 'DisplayName', 'Ground Truth');

%idx2 = find(class_decision >0);
%idx_int = intersect(idx, idx2);

%plot(x(idx_int), class_decision(idx_int), 'x','Color','blue', 'DisplayName', 'Decision');

ylim([0.5 length(truth_label)+0.5]);
legend([t d], 'Ground Truth', 'Decision');

end

function obj = draw_trace(clbl, color, yoffset)
    for i=1:size(clbl, 2)
        x = [clbl(1,i) clbl(2,i)];
        y = [clbl(3,i) clbl(3,i)] + yoffset;
        obj = plot(x, y, '-', 'Color', color, 'LineWidth', 5);
    end
end
